// 类似的题 674.最长连续递增序列

class Solution {
public:
    int maxAscendingSum(vector<int>& nums) {
        int maxSum = nums[0];
        int current = nums[0];
        int currentSum = maxSum;
        for (int i = 1; i < nums.size(); ++i)
        {
            if (nums[i] > current)
            {
                currentSum += nums[i];
                maxSum = max(maxSum, currentSum);
            }
            else
            {
                currentSum = nums[i];
            }
            current = nums[i];
        }
        return maxSum;
    }
};